<?php

error_reporting(E_ALL);

include_once('top.php');

if (!empty($_GET['user'])) {
	$nemail = mysql_real_escape_string($_GET['user']);
} else {
	$nemail = $email;
}

$user = fetch_only("SELECT First_name, Last_name, Email FROM USER WHERE Email = '$nemail' LIMIT 1");
$certifications = fetch_all("SELECT Title FROM CERTIFICATION WHERE User = '$nemail'");

?>

<html>
<head>
	<title>GT Project Manager - View Employee</title>
	<link rel="stylesheet" type="text/css" href="main.css" />
	<link rel="stylesheet" type="text/css" href="inner.css" />
</head>
<body>
	<table cellspacing="0" cellpadding="0" id="main">
		<tr><td id="title">
			<?php echo "{$user['First_name']} {$user['Last_name']}"; ?>
			<div class="nav">
				<a href="login.php?action=logout">Log Out</a><br />
				<?php echo $link ?><br />
				<a href="employee_info.php?user=<?php echo $_GET['user'] ?>">Edit Employee</a>
			</div>
		</td></tr>
		<tr>
			<td>
				<table class="details" cellspacing="0" cellpadding="0">
					<tr>
						<th>Email</th>
						<td><a href="mailto:<?php echo $nemail ?>"><?php echo $nemail ?></a></td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td>
				<table class="subsection" cellspacing="0" cellpadding="0">
					<tbody id="container">
						<tr><td class="title">
							Certifications
							<hr size="1" />
						</td></tr>
						<?php
						foreach($certifications as $certification) {
						?>
						<tr><td><?php echo $certification['Title'] ?></td></tr>
						<?
						}
						?>
					</tbody>
				</table>
			</td>
		</tr>
	</table>
</body>
</html>
